package cn.zhaoyuening.zhaocloud.common.bean;

public class CloudServiceBean implements Comparable<CloudServiceBean>{
	private String serviceName;
	private String version;
	
	public String getServiceName() {
		return serviceName;
	}
	public void setServiceName(String serviceName) {
		this.serviceName = serviceName;
	}
	public String getVersion() {
		return version;
	}
	public void setVersion(String version) {
		this.version = version;
	}
	public CloudServiceBean(String serviceName, String version) {
		super();
		this.serviceName = serviceName;
		this.version = version;
	}
	
	public int compareTo(CloudServiceBean bean) {
		if(bean.serviceName!=null&&this.version!=null&&
				bean.serviceName.equals(this.serviceName)&&this.version.equals(bean.version)){
			return 0;
		}
		return 1;
	}
	
	

	@Override
	public boolean equals(Object obj) {
		if (obj instanceof CloudServiceBean) {
			CloudServiceBean bean = (CloudServiceBean) obj;
			if(((CloudServiceBean) obj).compareTo(this)==0){
				return true;
			}
			return false;
		}
		return super.equals(obj);
	}
}
